//
//  CelebrityinkVcCell.m
//  Wy_Reading
//
//  Created by wangyang on 2020/2/10.
//  Copyright © 2020 wangyang. All rights reserved.
//

#import "CelebrityinkVcCell.h"

@implementation CelebrityinkVcCell
-(id)initWithFrame:(CGRect)frame

{
    if (self = [super initWithFrame:frame]) {

        [self BackView];
        
        NSArray *fuleiArray = @[@"傅雷家书",@"傅雷",@"综合评分：4.8",@"¥29.50"];
        for (int i = 0; i<fuleiArray.count; i++) {
            UILabel *labe = [UILabel labelWithContent:fuleiArray[i]superView:self.BackView textColor:WyBlackColor font:WySYSTEMFONT(12) textAlignment:NSTextAlignmentLeft];
            [labe mas_makeConstraints:^(MASConstraintMaker *make) {
                make.size.equalTo(CGSizeMake(BiLiWidth(200), BiLiWidth(20)));
                make.left.equalTo(self.PicImg.right).offset(BiLiWidth(2));
                make.top.mas_offset(BiLiWidth(10)+BiLiWidth(25)*i);
            }];
            labe.tag = i;
            if (labe.tag == 0) {
                _NameLabe = labe;
            }else if (labe.tag == 1)
            {
                _UserNameLabe = labe;
                _UserNameLabe.textColor = UIColorFromRGB(0x999999);
                
            }
            else if (labe.tag == 2)
            {
                _ScoreLabe = labe;
                _ScoreLabe.textColor = UIColorFromRGB(0xFADB14);
        
            }
            else if (labe.tag == 3)
            {
                _MoneyLabe = labe;
                _MoneyLabe.textColor = UIColorFromRGB(0xFF4949);
                
            }
        }
        
    }
    return self;
}


- (UIView *)BackView

{
    if (!_BackView) {
        
        _BackView = [[UIView alloc]init];
        [self addSubview:_BackView];
        _BackView.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0];
        _BackView.layer.shadowColor = [UIColor colorWithRed:8/255.0 green:6/255.0 blue:6/255.0 alpha:0.1].CGColor;
        _BackView.layer.shadowOffset = CGSizeMake(0,2);
        _BackView.layer.shadowOpacity = 1;
        _BackView.layer.shadowRadius = 6;
        _BackView.layer.cornerRadius = 10;
        [_BackView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.equalTo(CGSizeMake(BiLiWidth(167), BiLiWidth(115)));
            make.top.mas_offset(BiLiWidth(10));
            make.centerX.mas_offset(0);
        }];
        [self PicImg];
        
    }
    return _BackView;
}

- (UIImageView *)PicImg

{
    if (!_PicImg) {
        _PicImg = [UIImageView imageWithImgName:@"" superView:self.BackView];
        _PicImg.backgroundColor = WyColor;
        WyViewRadius(_PicImg, BiLiWidth(5));
        [_PicImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.equalTo(CGSizeMake(BiLiWidth(80), BiLiWidth(95)));
            make.top.mas_offset(BiLiWidth(10));
            make.left.mas_offset(BiLiWidth(5));
        }];
    }
    return _PicImg;
}

@end
